//
//  AXShoppingCartHeaderView.m
//  hwacdx 购物车店铺标题视图
//
//  Created by hwacdx on 2019/6/3.
//  Copyright © 2019年 hwacdx. All rights reserved.
//

#import "AXShoppingCartHeaderView.h"

@interface AXShoppingCartHeaderView()

@property (weak, nonatomic) IBOutlet UIButton *checkBtn;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@end

@implementation AXShoppingCartHeaderView

- (void)setStoreName:(NSString *)storeName{
    self.titleLabel.text = storeName;
}

- (IBAction)buttonAction:(UIButton *)sender {
    self.isSelected = !self.isSelected;
    if (_delegate && [_delegate respondsToSelector:@selector(shoppingCartHeaderView_buttonActionAtSection:isSelected:)]) {
        [_delegate shoppingCartHeaderView_buttonActionAtSection:self.section isSelected:self.isSelected];
    }
}

- (void)setIsSelected:(BOOL)isSelected{
    _isSelected = isSelected;
 
    if (isSelected) {
        [self.checkBtn setImage:[UIImage imageNamed:@"ic_pitchon"] forState:UIControlStateNormal];
    } else {
        [self.checkBtn setImage:[UIImage imageNamed:@"ic_unchecked"] forState:UIControlStateNormal];
    }
}

@end
